import request from '@/utils/request'
let baseURL = '/portal-server/v1/api'

/**
 * 获取报表类型下拉
 */
export const getReportDownApi = () => {
	return request({
		url: `${baseURL}/report/reportDown`,
		method: 'get',
	})
};
/**
 * 专项报表列表  入参属性如下
 * @param pageNo            起始页
 * @param pageSize          每页条数
 * @param statementNumber   报表编号
 * @param statementType     报表类型
 */
export const queryReportListApi = (data) => {
	return request({
		url: `${baseURL}/report/reportList`,
		method: 'post',
		data: data
	})
};
/**
 * 商业-能源地图-图表  入参属性如下
 * @param biProjectCode   		bi项目编码
 * @param cityId       				城市
 * @param formatCode  				业态
 * @param groupCode   				集团
 * @param yearmonth   				月份
 */
export const queryBusinessEnergyChartListApi = (data) => {
	return request({
		url: `${baseURL}/report/energyChartList`,
		method: 'post',
		data: data
	})
};
/**
 * 商业-能源地图-列表  入参属性如下
 * @param biProjectCode   		bi项目编码
 * @param cityId       				城市
 * @param formatCode  				业态
 * @param groupCode   				集团
 * @param yearmonth   				月份
 * @param pageNo        			起始页
 * @param pageSize      			每页条数
 */
export const queryBusinessEnergyMapListApi = (data) => {
	return request({
		url: `${baseURL}/report/energyList`,
		method: 'post',
		data: data
	})
};
// 商业能源地图--项目下拉
export const projectDropDownApi = (data) => {
	return request({
		url: `${baseURL}/report/energyProjectDown`,
		method: 'post',
		data: data,
	})
};
// 商业能源地图--表格数据--导出
export const exportBusinessEnergyListApi = (data) => {
	return request({
		url: `${baseURL}/report/energyListExport`,
		method: 'post',
		data: data,
		responseType: 'blob'
	})
};
// 商业能源地图--图表数据--导出
export const exportBusinessEnergyGraphExportApi = (data) => {
	return request({
		url: `${baseURL}/report/energyGraphExport`,
		method: 'post',
		data: data,
		responseType: 'blob'
	})
};

/**
 * 物业能源地图
 */
export const queryPropertyEnergyMapListApi = (data) => {
	return request({
		url: `${baseURL}/wyReport/wyEnergyList`,
		method: 'post',
		data: data
	})
};
// 物业能源地图--图表数据
export const queryPropertyEnergyChartApi = (data) => {
	return request({
		url: `${baseURL}/wyReport/wyEnergyChartList`,
		method: 'post',
		data: data
	})
};

// 物业能源地图--项目下拉
export const propertyProjectDropDownApi = (data) => {
	return request({
		url: `${baseURL}/wyReport/wyEnergyProjectDown`,
		method: 'post',
		data: data,
	})
};

// 商业能源地图--表格数据--导出
export const exportPropertyEnergyListApi = (data) => {
	return request({
		url: `${baseURL}/wyReport/wyEnergyListExport`,
		method: 'post',
		data: data,
		responseType: 'blob'
	})
};
// 商业能源地图--图表数据--导出
export const exportPropertyEnergyGraphExportApi = (data) => {
	return request({
		url: `${baseURL}/wyReport/wyEnergyGraphExport`,
		method: 'post',
		data: data,
		responseType: 'blob'
	})
};

// 品牌分析相关接口
export const brandAnalysisApi = {
	// 获取品牌
	queryBrandDownListApi:(params) => {
		return request({
			url: `${baseURL}/webBrand/brandFilterBox`,
			method: 'post',
			data: params,
		})
	},
	// 获取品牌分析列表
	queryBrandAnalysisListApi:(params) => {
		return request({
			url: `${baseURL}/webBrand/brandList`,
			method: 'post',
			data: params,
		})
	},
	// 品牌分析 -- 导出
	brandExportApi:(params) => {
		return request({
			url: `${baseURL}/webBrand/brandExport`,
			method: 'post',
			data: params,
			responseType: 'blob',
		})
	},
	// 获取品牌业绩页 -- 卡片数据
	wxBrandPerformanceApi:(params) => {
		return request({
			url: `${baseURL}/brand/wxBrandPerformance`,
			method: 'post',
			data: params,
		})
	},
	// 获取品牌业绩页 -- table数据
	wxBrandPerformanceListApi:(params) => {
		return request({
			url: `${baseURL}/brand/wxBrandPerformanceList`,
			method: 'post',
			data: params,
		})
	},
	// 获取品牌分析明细列表
	queryBrandAnalysisDetailListApi:(params) => {
		return request({
			url: `${baseURL}/webBrand/brandListDetail`,
			method: 'post',
			data: params,
		})
	},
	// 导出品牌分析明细列表
	exportBrandAnalysisDetailListApi:(params) => {
		return request({
			url: `${baseURL}/webBrand/brandListExport`,
			method: 'post',
			data: params,
			responseType: 'blob'
		})
	}
}

// 项目建筑面积
export const queryProjectBuildAreaListApi = (data)=>{
	return request({
		url: `${baseURL}/areaReport/queryBuildingAreaReportList`,
		method: 'post',
		data,
	})
}
// 项目建筑面积
export const exportProjectBuildAreaListApi = (data)=>{
	return request({
		url: `${baseURL}/areaReport/buildingAreaListExport`,
		method: 'post',
		data,
		responseType: 'blob',
	})
}

// 月度周平均销售额专项表
export const avgSalesTotalApi = (data)=>{
	return request({
		url: `${baseURL}/report/avgSalesTotal?biProjectCode=${data.biProjectCode}&yearmonth=${data.yearmonth}&bizSpecType=${data.bizSpecType}`,
		method: 'get',
	})
}

// 月度周平均销售额专项表 -- 导出
export const avgSalesExportApi = (data)=>{
	return request({
		url: `${baseURL}/report/avgSalesExport?biProjectCode=${data.biProjectCode}&yearmonth=${data.yearmonth}&bizSpecType=${data.bizSpecType}`,
        method: 'get',
        // data: data,
        responseType: 'blob'
	})
}